<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }
    #grandfather {
      width: 500px;
      height: 500px;
      background-color: red;
     
    }
    #father {
      width: 300px;
      height: 300px;
      background-color: yellow;
      
    }
    #son {
      width: 100px;
      height: 100px;
      background-color: blue;
      position: absolute;
      left: 700px;
      top: 700px;
    }
    /* 
      绝对定位：
        1、根据最近的有定位的父系(祖先及元素)元素做定位，如果都没有定位，根据body做定位
        2、脱离文档流
    */
  </style>
</head>
<body>
  <div id="grandfather">
    <div id="father">
      <div id="son"></div>
    </div>
  </div>
</body>
</html>